﻿using Microsoft.EntityFrameworkCore.Metadata.Internal;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using ZhiJiao.Models.Entities.Enums;

namespace ZhiJiao.Models.Entities
{
    /// <summary>
    /// 课程
    /// </summary> 
    public class Course : BaseEntity
    {
        /// <summary>
        /// 所属机构
        /// </summary>
        public Instruction Instruction { get; set; }

        public long InstructionId { get; set; }

        /// <summary>
        /// 课程名
        /// </summary>
        [Column(TypeName = "varchar(200)")]
        public string? Name { get; set; }

        /// <summary>
        /// 课程类型
        /// </summary>
        public CourseType CourseType { get; set; } = 0;

        /// <summary>
        /// 课时节数
        /// </summary>
        public int ClassCount { get; set; } = 10;

        /// <summary>
        /// 单节课持续长度
        /// 单位: minute
        /// </summary>
        public int Duration { get; set; } = 45;

        /// <summary>
        /// 适宜年龄段
        /// </summary>
        [Column(TypeName = "varchar(200)")]
        public string? ForAge { get; set; }

        /// <summary>
        /// 主图
        /// </summary>
        public CourseImage? MainImage { get; set; }

        /// <summary>
        /// 列表图
        /// </summary>
        public CourseImage? ListImage { get; set; }

        /// <summary>
        /// 详情图片
        /// 多个，英文逗号隔开
        /// </summary>
        public List<CourseImage>? DetailImages { get; set; }

        /// <summary>
        /// 课程简介
        /// </summary>
        [Column(TypeName = "varchar(max)")]
        public string? Introdution { get; set; }


        /// <summary>
        /// 是否免费
        /// </summary>
        public bool? IsFree { get; set; }

        /// <summary>
        /// 正常价格
        /// </summary>
        public decimal? NormalPrice { get; set; }

        /// <summary>
        /// 白银会员价
        /// </summary>
        public decimal? SilverPrice { get; set; }

        /// <summary>
        /// 黄金会员价
        /// </summary>
        public decimal? GoldPrice { get; set; }

        /// <summary>
        /// 钻石会员价格
        /// </summary>
        public decimal? DiamondPrice { get; set; }

        /// <summary>
        /// 参与规则
        /// </summary>
        public List<Rule> Rules { get; set; }

        /// <summary>
        /// 有效性
        /// </summary>
        public bool IsActive { get; set; } = true;
    }
}
